package com.benz.order.controller;

import com.benz.order.entity.Order;
import com.benz.order.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/orders")
public class OrderController {

    @Autowired
    private IOrderService orderService;

    @GetMapping("/{id}")
    public String getOrderNo(@PathVariable("id") Long orderId) {
        System.out.println("orderId:"+orderId);
        //Order order= orderService.getOrderList();
        //System.out.println(order);
        return "xxxxewewe";
    }

    @GetMapping("/getOrderNo")
    public Order getOrderNo2(@RequestParam Long orderId) {
        Map<String, Object> map = new HashMap<>();
        return orderService.getOrderList();
    }
}
